import QtQuick
import QtQuick.Controls
import QtQuick.Layouts
import "./uicontrol" as MyControls

ApplicationWindow {
    id: rootWindow
    width:730
    height:510
    maximumWidth: 730
    maximumHeight: 510
    minimumWidth:730
    minimumHeight: 510
    visible: true
    title: qsTr("ToxDesk")
    //flags:   Qt.CustomizeWindowHint | Qt.WindowTitleHint|Qt.WindowSystemMenuHint|Qt.WindowMinimizeButtonHint|Qt.WindowMaximizeButtonHint|Qt.WindowCloseButtonHint

    RowLayout {
        width: parent.width
        height: parent.height
        spacing:0

        ColumnLayout{
            width:160
            anchors.top: parent.top
            height: parent.height
            Rectangle {
                anchors.fill: parent
                color: "#F0F3F8"
                //border.color : "#00ff00"
            }

            Image {
                id:logo
                anchors.top: parent.top
                anchors.horizontalCenter:parent.horizontalCenter
                source: "qrc:/images/remote-desktop.png"
                sourceSize:Qt.size(120,120)
            }


            ButtonGroup {
                buttons: column.children
            }
            Column {
                id: column
                spacing: 20
                topPadding:30
                anchors.top:  logo.bottom
                anchors.horizontalCenter:parent.horizontalCenter
                width: parent.width-30
                MyControls.RadioBtnColor {
                    id:remotectl
                    text:qsTr("remoteCtrl")
                    font.pointSize: 12
                    //font.bold: true
                    height:38
                    width: parent.width
                    checked:true
                    textcolor:"#696969"
                    selectedtextcolor:"#FFFFFFFF"
                    hotcolor:"#E0E6EE"
                    selectedcolor:"#8EABDD"
                    foreimage:"qrc:/images/icon_downloading_normal.png"
                    hotforeimage :"qrc:/images/icon_downloading_hover.png"
                    selectedforeimage :"qrc:/images/icon_downloading_pushed.png"

                    onToggled: {
                        console.info("cleck")
                        stackView.pop()
                        stackView.push("qrc:/remote.qml")
                    }
                }

                MyControls.RadioBtnColor {

                    id:syssetting
                    text:qsTr("sysSetting")
                    font.pointSize: 12
                    height:38
                    checked:false
                    width: parent.width
                    textcolor:"#696969"
                    selectedtextcolor:"#FFFFFFFF"
                    hotcolor:"#E0E6EE"
                    selectedcolor:"#8EABDD"
                    foreimage:"qrc:/images/catalog_normal.png"
                    hotforeimage :"qrc:/images/catalog_hover.png"
                    selectedforeimage :"qrc:/images/catalog_pushed.png"

                    onToggled: {
                        console.info("cleck")
                        stackView.pop()
                        stackView.push("qrc:/setting.qml")
                    }
                }


            }
        }

        StackView {
            id: stackView
            background: Rectangle {
                color: "#ffffff"
                //border.color : "#ff0000"
            }

            pushEnter: Transition {
                PropertyAnimation {
                    property: "opacity"
                    from: 0
                    to:1
                    duration: 200
                }
            }
            pushExit: Transition {
                PropertyAnimation {
                    property: "opacity"
                    from: 1
                    to:0
                    duration: 200
                }
            }
            popEnter: Transition {
                PropertyAnimation {
                    property: "opacity"
                    from: 0
                    to:1
                    duration: 200
                }
            }
            popExit: Transition {
                PropertyAnimation {
                    property: "opacity"
                    from: 1
                    to:0
                    duration: 200
                }
            }
            Layout.fillWidth:true
            Layout.fillHeight:true
            initialItem: "qrc:/remote.qml"
        }

    }

}

